<!--
 * @Author: qiaoxin
 * @Date: 2024-04-09 19:35:26
 * @LastEditors: qiaoxin
 * @LastEditTime: 2024-04-16 12:03:50
 * @Description: 
 * @FilePath: \erp-app\src\pages\pm\requirement\detail.vue
-->

<route lang="json5">
{
  layout: 'default',
  style: {
    navigationBarTitleText: '需求描述',
    enablePullDownRefresh: false,
    navigationStyle: 'custom',
  },
}
</route>

<template>
  <page-meta :root-font-size="setting.rootFontSize"></page-meta>
  <view style="min-height: 100vh; background-color: #f2f2f1">
    <view style="position: sticky; top: 0; z-index: 9999">
      <wd-navbar title="需求描述" :bordered="false" safeAreaInsetTop>
        <template #left>
          <wd-icon name="thin-arrow-left" size="22px" color="white" @click="goBack"></wd-icon>
        </template>
      </wd-navbar>
    </view>

    <view>
      <text class="text" style="padding: 10rpx; font-size: 40rpx; line-height: 60rpx">
        {{ form.demandDesc }}
      </text>
      <!-- <textarea :value="form.demandDesc" disabled style="width: 100%; height: 100%"></textarea> -->
    </view>
  </view>
</template>

<script lang="ts" setup>
import { useSetting } from '@/stores/setting';
import { getObj } from '@/service/pm-requirement';
import { useUserStore } from '@/stores/user';

const setting = useSetting();
const userStore = useUserStore();

// 提交表单数据
const form = reactive({
  id: '',
  demandDate: '',
  personName: '',
  demandType: null,
  deptHead: '',
  deptCode: '',
  applicationType: '',
  samplesNum: '',
  demandDesc: '',
  sampleCoding: '',
  askCompleteTime: null,
  taskCode: '',
  userCode: '',
  invName: '',
  invDemand: '',
  sampleFlag: null,
  demandCode: '',
  cusName: '',
  personCode: '',
  deptHeadCode: '',
  cusFlag: '0',
  demandResult: '',
  completeTime: '',
  // technologyHead: '',
  // technologyHeadName: '',
  remark: '',
  // technologyHeadCode: '',
  taskId: null,
  instanceId: '',
  invStd: '',
  sampleCode: '',
  sampleBatch: '',
  deptName: '',
  rdFlag: null,
  chiefEngineer: '',
  deputyChiefEngineer: '',
  status: '',
  sampleFlagName: '',
  deputyChiefEngineerUrl: '',
  chiefEngineerUrl: '',
  sampleUnit: '',
  cusCode: null,
  rdProjectUserEntity: [],
  wayName: '',
  rdInformationDTO: [],
  rdCraftEntity: [],
  rdSampleAnalysisEntity: [],
  rdTaskFileEntity: [],
});

const init = (id) => {
  uni.showLoading({
    mask: true,
  });
  getObj({ id })
    .then((res) => {
      console.log('res', res);
      Object.assign(form, res.data);
    })
    .finally(() => {
      uni.hideLoading();
      uni.stopPullDownRefresh();
    });
};

onLoad((options) => {
  console.log('opp', options);
  const id = options.id;
  init(id);
});

const goBack = () => {
  uni.navigateBack();
};
</script>

<style lang="scss" scoped>
@import '../experiment/components/table';

.card-detail {
  padding: 0 !important;
}

.wd-cell {
  padding-left: 0 !important;
}

.wd-card__title {
  border-left: 4px solid #2e5cf6 !important;
}

.pm-table {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 0 30rpx;

  .pm-title {
    box-sizing: border-box;
    padding-left: 20rpx;
    margin: 40rpx 0;
    font-size: 32rpx;
    font-weight: bold;
    color: #333;
    border-left: 8rpx solid #2e5cf6;
    border-radius: 4rpx;
  }

  .pm-row {
    display: flex;
    min-height: 60rpx;
    border-bottom: 1px solid #f6f0f0;

    .pm-label {
      display: flex;
      align-items: center;
      width: 20%;
      font-size: 26rpx;
      color: #979494;
    }

    .pm-value {
      display: flex;
      flex: 1;
      align-items: center;
      font-size: 26rpx;
      color: #333;
    }
  }
}

.sign-main {
  // display: flex;
  // align-items: center;
  // justify-content: center;
  // width: 100%;
  // margin: 20rpx 0;
  position: fixed;
  right: 0rpx;
  bottom: 40rpx;
  width: 160rpx;
  height: 80rpx;
  line-height: 80rpx;
  color: white;
  text-align: center;
  background-color: rgb(77 128 240);

  // border-radius: 50%;
  border-top-left-radius: 40rpx;
  border-bottom-left-radius: 40rpx;
}

:deep(.label) {
  width: 160rpx !important;
}

.result-tag {
  padding: 6rpx 14rpx;
  margin: 4rpx;
  font-size: 24rpx;
  color: white;
  background-color: #87d068;
  border-radius: 4rpx;
}

.sign-main-show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  .sign-main-show-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80rpx;
    margin-bottom: 20rpx;
    font-size: 30rpx;
    font-weight: bold;
    color: #818181;
    border-bottom: 1px solid #e3e3e3;
  }

  .sign-main-show-line {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    padding: 20rpx;
    margin: 20rpx 0;
    border: 4rpx solid #d0dbff;
    border-radius: 10rpx;
  }

  .sign-main-show-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80rpx;
    border-top: 1px solid #e3e3e3;
  }
}

.sign-gray {
  background-color: gray;
}

.form-demandDesc {
  align-items: flex-start !important;

  .text {
    word-break: break-all;
  }
}

.form-CheckTarget {
  flex-direction: column !important;
  align-items: start !important;
}

.info-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.info-list-main {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 10rpx;
  margin: 10rpx 0;
  border: 1px solid #e3e3e3;
  border-radius: 8rpx;

  .info-list-row {
    display: flex;
    width: 100%;

    .info-list-label {
      width: 150rpx;
      font-size: 28rpx;
      color: #808080;
    }

    .info-list-value {
      display: flex;
      flex: 1;
      align-items: center;
      width: 0;
      word-break: break-all;
      white-space: pre-line;
    }
  }
}

.craft-row {
  display: flex;
  align-items: center;

  .craft-row-img-main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 0;
  }
}

.craft-row-img {
  width: 240rpx;
  height: 240rpx;
}
</style>
